// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
import ViewUI from 'view-design'
import 'view-design/dist/styles/iview.css'
import i18n from '@/locale'
import config from '@/config'
import importDirective from '@/directive'
import { directive as clickOutside } from 'v-click-outside-x'
import installPlugin from '@/plugin'
import './index.less'

// import '@/libs/rem.js'
import '@/assets/icons/iconfont.css'
import dayjs from 'dayjs'

import 'xe-utils'

// 完整导入 UI 组件库
import VxeUI from 'vxe-pc-ui'
import 'vxe-pc-ui/lib/style.css' 
// 完整导入 表格库
import VXETable from 'vxe-table'
import 'vxe-table/lib/style.css' 
import '@/vxe-table.scss'
 
import 'viewerjs/dist/viewer.css'
import VueViewer from 'v-viewer'
import dataV from '@jiaminghi/data-view'
Vue.prototype.dayjs = dayjs
// 实际打包时应该不引入mock
/* eslint-disable */
// if (process.env.NODE_ENV !== 'production') require('@/mock')

Vue.use(ViewUI, {
  i18n: (key, value) => i18n.t(key, value)
}) 

// 将自动注册所有组件为全局组件  

Vue.use(dataV)
 
VXETable.setConfig({
  table: {
    showHeader: true,
    keepSource: false,
    showOverflow: null,
    showHeaderOverflow: null,
    showFooterOverflow: null,
    size: 'small',
    autoResize: true,
    stripe: true,
    border: false,
    round: false,
    emptyText: '暂无数据~',
    minHeight:40,
    resizeConfig: {
      refreshDelay: 250
    },
    customConfig:{
       enabled:true,
       storage: true
    },
    columnConfig:{
      resizable:true,
      useKey:true,
      drag:true,
    },
    columnDragConfig:{
      showIcon:false,
      trigger:'cell',
      disabledMethod ({ column }) {
        if (column.field === 'checkbox') {
          return true
        }
        return false
      },
    },
    virtualXConfig:{
      enabled: true,
       gt: 0
    },
    virtualYConfig:{
      enabled: true,
       gt: 0
    },
    scrollX: {
      enabled: true,
       gt: 0
      // oSize: 0
    },
    scrollY: {
      enabled: true,
       gt: 0
      // oSize: 0
    },
    rowConfig: {
      keyField: '_X_ROW_KEY', // 行数据的唯一主键字段名,
      isHover: true,
      isCurrent: true,
    },
    keyboardConfig: {
      isArrow: true
    },
    radioConfig: {
      trigger: 'row'
    },
    checkboxConfig: {
      strict: true,
      highlight: true,
      range: false,
      trigger: 'row'
    },
    sortConfig: {
      multiple: false,
      remote: false,
      trigger: 'cell',
      orders: ['asc', 'desc', null],
      sortMethod: null
    },
    filterConfig: {
      remote: false,
      filterMethod: null
    },
    expandConfig: {
      trigger: 'default',
      showIcon: true
    },
    treeConfig: {
      rowField: 'id',
      parentField: 'parentId',
      children: 'children',
      hasChild: 'hasChild',
      mapChildren: '_X_ROW_CHILD',
      indent: 20,
      showIcon: true
    },
    tooltipConfig: {
      enterable: true
    },
   
  },
   
})

Vue.use(VxeUI)
Vue.use(VXETable) 

Vue.use(VueViewer, {
  defaultOptions: {
    zIndex: 9999, // 这里设置层级高度
  }
})
/**
 * @description 注册admin内置插件
 */
installPlugin(Vue)
/**
 * @description 生产环境关掉提示
 */
Vue.config.productionTip = false
/**
 * @description 全局注册应用配置
 */
Vue.prototype.$config = config
/**
 * 注册指令
 */
importDirective(Vue)
Vue.directive('clickOutside', clickOutside)

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  i18n,
  store,
  render: h => h(App)
})
